<!doctype html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
        integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

    <title>Optimus Cheat Sheet</title>
    <style>
        body {
            background-color: #00a58c;
        }

        span.commentary {
            font-size: 0.8em;
            margin-bottom: 1em;
            display: inline-block;
        }

        h3 {
            margin-top: 0.5em;
        }

        .container {
            background-color: #ffffff;
            padding-top: 2em;
            padding-bottom: 2em;
            marging-top: 2em;
            margin-bottom: 2em;
        }

        .gray-dark {
            background-color: #7e7e7e;
        }

        .gray {
            background-color: #aeabab;
        }

        .gray-light {
            background-color: #ccc;
        }

        .green {
            background-color: #6fac46;
        }

        .green-light {
            background-color: #c5dfb4;
        }

        .orange {
            background-color: #ec7c30;
        }

        .orange-light {
            background-color: #f8caac;
        }

        .blue {
            background-color: #4471c4;
        }

        .blue-light {
            background-color: #bcd6ed;
        }

        .red {
            background-color: #ec3030;
        }

        .red-light {
            background-color: #ff8484;
        }

        .table-operations-no-data {
            border-collapse: initial;
            color: #ffffff !important;
            margin-bottom: 0.7em !important;

            background-color: #ffffff
        }

        .table-operations-no-data td {
            width: 1.5em;
            height: 0.7em;

        }

        .table-operations-with-data {
            border-collapse: initial;
            color: #ffffff !important;
            margin-bottom: 0.7em !important;
            background-color: #ffffff
        }

        .table-operations-with-data td {
            /*width: 1.5em;
            height: 0.7em;*/
            font-size: 0.5em;
            padding: 0.2em 0.2em;
            text-align: center;

        }

        .table-info {
            font-size: 0.8em;
            background-color: #ffffff;
            width: 100%;
            margin-bottom: 2em;
        }

        .table-info code {
            background-color: unset;
        }

        .table-info tr td:first-child {
            font-weight: bold;
        }

        .table-data {
            width: 100%;
            font-size: 0.8em;
            margin-top: 1em;
            /*border: 1px;
            border-spacing: 1px;*/
            border-collapse: separate;
        }

        .table-data thead {
            background-color: #4471c4;
            color: white;
            font-weight: 700;
        }

        .table-data tbody {
            background-color: #bcd6ed;
        }

        .table-data td {
            padding: 0.25em 0.5em;
        }

        pre {
            font-size: 0.8em;
            margin-bottom: 0;
        }

        p {
            font-size: 0.7em;
        }

        .operation-symbol {
            font-size: 3em;
            font-weight: bold;
            line-height: 1;
            margin: 0 0.1em;
        }
    </style>
</head>

<body>

    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
        integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
        crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
        integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
        crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
        integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
        crossorigin="anonymous"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" />
    <script>hljs.initHighlightingOnLoad();</script>


    <div class="container">
        <h1>Optimus Cheat Sheet</h1>
        <span>Agile Data Science Workflows made easy.</span>
        <div class="row">
            <div class="col-sm-4">
                <h3>Initialize Optimus</h3>
                <pre><code class="python">from optimus import Optimus
op = Optimus("pandas")</code></pre>
                <span class="commentary">Import optimus</span>
                <h3>Creating DataFrames</h3>
                <pre><code class="python">df = op.create.dataframe({
    ("names"): ["bumbl#ebéé  ", "Optim'us", "ironhide&"],
    ("height", "float"): [17.5, 28.0, 26.0],
    "function": ["Espionage", "Leader", "Security"],
    ("rank", "int"): [7, 10, 7]
})</code></pre>

                <table class="table-data">
                    <thead>
                        <tr>
                            <td>names</td>
                            <td>height</td>
                            <td>function</td>
                            <td>rank</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>bumbl#ebéé⸱⸱</td>
                            <td>17.5</td>
                            <td>Espionage</td>
                            <td>7</td>
                        </tr>

                        <tr>
                            <td>Optim'us</td>
                            <td>28.0</td>
                            <td>Leader</td>
                            <td>10</td>
                        </tr>
                        <tr>
                            <td>ironhide&</td>
                            <td>26.0</td>
                            <td>Security</td>
                            <td>7</td>
                        </tr>
                    </tbody>
                </table>
                <span class="commentary">Specify values for each column.</span>

                <h3>Data Loading</h3>

                <pre><code class="python">df = op.load.csv("foo.csv")
df = op.load.json("foo.json")
df = op.load.parquet("foo.parquet")
df = op.load.excel("foo.xls")
df = op.load.avro("foo.avro")
df = op.load.file("foo.anything")
</code></pre>
                <span class="commentary">Load a file</span>


                <pre><code class="python">df = op.load.csv("http://.../foo.csv")
df = op.load.json("http://./f.json")
df = op.load.file("http://./f.parquet")
</code></pre>
                <span class="commentary">Load a file to a dataframe from a URL</span>
                <h3>Data Saving</h3>

                <pre><code class="python">df.save.csv("directory/foo.csv")
df.save.json("directory/foo.json")
df.save.parquet("directory/foo.parquet")
df.save.excel("directory/foo.xls")
df.save.avro("directory/foo.avro")
</code></pre>
                <span class="commentary">Save a local file</span>
                <h3>Method Chaining</h3>
                <span class="commentary">Most Optimus methods return a DataFrame so that another Optimus method can be
                    applied to the result. This
                    improved readability of code.</span>
                <pre><code class="python">df = df\
    .rows.sort(["rank", "height"])\
    .cols.lower(["names", "function"])\
    .cols.normalize_chars("names")\
    .cols.remove_special_chars("names")\
    .cols.trim("names")</code></pre>

                <table class="table-data">
                    <thead>
                        <tr>
                            <td>names</td>
                            <td>height</td>
                            <td>function</td>
                            <td>rank</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>optimus</td>
                            <td>28.0</td>
                            <td>leader</td>
                            <td>10</td>
                        </tr>

                        <tr>
                            <td>ironhide</td>
                            <td>26.0</td>
                            <td>security</td>
                            <td>7</td>
                        </tr>
                        <tr>
                            <td>bumblebee</td>
                            <td>17.5</td>
                            <td>espionage</td>
                            <td>7</td>
                        </tr>
                    </tbody>
                </table>

                <h3>Summarize Data</h3>
                <span class="commentary">
                    Optimus provides a large set o summary functions.
                </span>


                <pre><code class="python">df.cols.sum()</code></pre>
                <span class="commentary">Sum all values in a column.</span>

                <pre><code class="python">df.cols.min()</code></pre>
                <span class="commentary">Min value in a column.</span>

                <pre><code class="python">df.cols.max()</code></pre>
                <span class="commentary">Max value in a column.</span>

                <pre><code class="python">df.cols.median()</code></pre>
                <span class="commentary">Median value in a column.</span>

                <pre><code class="python">df.cols.mean()</code></pre>
                <span class="commentary">Mean value in a column.</span>

                <pre><code class="python">df.cols.std()</code></pre>
                <span class="commentary">Standard Deviation in a column.</span>

                <pre><code class="python">df.cols.quantile([0.25,0.75])</code></pre>
                <span class="commentary">Qunatiles in a column.</span>

                <h3>Machine Learning</h3>
                <pre><code class="python">model = df.ml.logistic_regression_text("sentence")</code></pre>
                <span class="commentary">Create a model using Logistic Regression text.</span>

                <pre><code class="python">model = df.ml.random_forest("diagnosis")</code></pre>
                <span class="commentary">Create a model using Random Forest.</span>

                <pre><code class="python">model = df.ml.decision_tree(cols, "diagnosis")</code></pre>
                <span class="commentary">Create a model using Decision Tree.</span>

                <pre><code class="python">model = df.ml.gbt(cols, "diagnosis")</code></pre>
                <span class="commentary">Create a model using Gradient Boosting Trees.</span>
            </div>

            <div class="col-sm-4">
                <h3>Reshaping Data</h3>

                <!-- Melt -->
                <pre><code class="python">df = df.melt(
    "names",
    ["height", "function", "rank"])</code></pre>
                <span class="commentary">Gather columns into rows.</span>

                <div class="flex-row d-flex">
                    <div>
                        <table class="table-operations-with-data">
                            <thead>
                                <tr>
                                    <td class="gray">names</td>
                                    <td class="green">height</td>
                                    <td class="orange">function</td>
                                    <td class="blue">rank</td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light">optimus</td>
                                    <td class="green-light">28.0</td>
                                    <td class="orange-light">leader</td>
                                    <td class="blue-light">10</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">ironhide</td>
                                    <td class="green-light">26.0</td>
                                    <td class="orange-light">security</td>
                                    <td class="blue-light">7</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">bumblebee</td>
                                    <td class="green-light">17.5</td>
                                    <td class="orange-light">espionage</td>
                                    <td class="blue-light">7</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="operation-symbol">
                        🡆
                    </div>
                    <div>
                        <table class="table-operations-with-data">
                            <thead>
                                <tr>
                                    <td class="gray">names</td>
                                    <td class="gray-dark">variable</td>
                                    <td class="gray-dark">value</td>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- 1st -->
                                <tr>
                                    <td class="gray-light">optimus</td>
                                    <td class="green">height</td>
                                    <td class="green-light">28.0</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">optimus</td>
                                    <td class="orange">function</td>
                                    <td class="orange-light">leader</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">optimus</td>
                                    <td class="blue">rank</td>
                                    <td class="blue-light">10</td>
                                </tr>
                                <!-- 2nd -->
                                <tr>
                                    <td class="gray-light">ironhide</td>
                                    <td class="green">height</td>
                                    <td class="green-light">26.0</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">ironhide</td>
                                    <td class="orange">function</td>
                                    <td class="orange-light">security</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">ironhide</td>
                                    <td class="blue">rank</td>
                                    <td class="blue-light">7</td>
                                </tr>
                                <!-- 3nd -->
                                <tr>
                                    <td class="gray-light">bumblebee</td>
                                    <td class="green">height</td>
                                    <td class="green-light">17.5</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">bumblebee</td>
                                    <td class="orange">function</td>
                                    <td class="orange-light">espionage</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">bumblebee</td>
                                    <td class="blue">rank</td>
                                    <td class="blue-light">7</td>
                                </tr>

                            </tbody>
                        </table>
                    </div>
                </div>


                <!-- Pivot -->
                <pre><code class="python">df = df.pivot("names", "variable", "value")</code></pre>
                <span class="commentary">Spread rows into columns.</span>
                <div class="flex-row d-flex">
                    <div>
                        <table class="table-operations-with-data">
                            <thead>
                                <tr>
                                    <td class="gray">names</td>
                                    <td class="gray-dark">variable</td>
                                    <td class="gray-dark">value</td>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- 1st -->
                                <tr>
                                    <td class="gray-light">optimus</td>
                                    <td class="green">height</td>
                                    <td class="green-light">28.0</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">optimus</td>
                                    <td class="orange">function</td>
                                    <td class="orange-light">leader</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">optimus</td>
                                    <td class="blue">rank</td>
                                    <td class="blue-light">10</td>
                                </tr>
                                <!-- 2nd -->
                                <tr>
                                    <td class="gray-light">ironhide</td>
                                    <td class="green">height</td>
                                    <td class="green-light">26.0</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">ironhide</td>
                                    <td class="orange">function</td>
                                    <td class="orange-light">security</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">ironhide</td>
                                    <td class="blue">rank</td>
                                    <td class="blue-light">7</td>
                                </tr>
                                <!-- 3nd -->
                                <tr>
                                    <td class="gray-light">bumblebee</td>
                                    <td class="green">height</td>
                                    <td class="green-light">17.5</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">bumblebee</td>
                                    <td class="orange">function</td>
                                    <td class="orange-light">espionage</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">bumblebee</td>
                                    <td class="blue">rank</td>
                                    <td class="blue-light">7</td>
                                </tr>

                            </tbody>
                        </table>
                    </div>
                    <div class="operation-symbol">
                        🡆
                    </div>
                    <div>
                        <table class="table-operations-with-data">
                            <thead>
                                <tr>
                                    <td class="gray">names</td>
                                    <td class="green">height</td>
                                    <td class="orange">function</td>
                                    <td class="blue">rank</td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light">optimus</td>
                                    <td class="green-light">28.0</td>
                                    <td class="orange-light">leader</td>
                                    <td class="blue-light">10</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">ironhide</td>
                                    <td class="green-light">26.0</td>
                                    <td class="orange-light">security</td>
                                    <td class="blue-light">7</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">bumblebee</td>
                                    <td class="green-light">17.5</td>
                                    <td class="orange-light">espionage</td>
                                    <td class="blue-light">7</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                </div>
                <!-- Concat Rows-->
                <pre><code class="python">df = df.rows.append([
  "Grimlock",
  "Commander",
  "80",
  "9"
])</code></pre>
                <span class="commentary">Append a dataframe as rows</span>
                <div class="flex-row d-flex">
                    <div>
                        <table class="table-operations-with-data">
                            <thead>
                                <tr>
                                    <td class="gray">names</td>
                                    <td class="green">height</td>
                                    <td class="orange">function</td>
                                    <td class="blue">rank</td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light">optimus</td>
                                    <td class="green-light">28.0</td>
                                    <td class="orange-light">leader</td>
                                    <td class="blue-light">10</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">ironhide</td>
                                    <td class="green-light">26.0</td>
                                    <td class="orange-light">security</td>
                                    <td class="blue-light">7</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">bumblebee</td>
                                    <td class="green-light">17.5</td>
                                    <td class="orange-light">espionage</td>
                                    <td class="blue-light">7</td>
                                </tr>
                            </tbody>
                        </table>
                        <table class="table-operations-with-data">
                            <thead>
                                <tr>
                                    <td class="gray">names</td>
                                    <td class="green">height</td>
                                    <td class="orange">function</td>
                                    <td class="blue">rank</td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light">Grimlock</td>
                                    <td class="green-light">80</td>
                                    <td class="orange-light">Commander</td>
                                    <td class="blue-light">9</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="operation-symbol">
                        }
                    </div>
                    <div>
                        <table class="table-operations-with-data">
                            <thead>
                                <tr>
                                    <td class="gray">names</td>
                                    <td class="green">height</td>
                                    <td class="orange">function</td>
                                    <td class="blue">rank</td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light">optimus</td>
                                    <td class="green-light">28.0</td>
                                    <td class="orange-light">leader</td>
                                    <td class="blue-light">10</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">ironhide</td>
                                    <td class="green-light">26.0</td>
                                    <td class="orange-light">security</td>
                                    <td class="blue-light">7</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">bumblebee</td>
                                    <td class="green-light">17.5</td>
                                    <td class="orange-light">espionage</td>
                                    <td class="blue-light">7</td>
                                </tr>
                                <tr>
                                    <td class="gray-light">Grimlock</td>
                                    <td class="green-light">80</td>
                                    <td class="orange-light">Commander</td>
                                    <td class="blue-light">9</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

                <pre><code class="python">df = df.rows.sort("names")</code></pre>

                <span class="commentary">Order rows by values of a column (low to high).</span>

                <pre><code class="python">df = df.rows.sort("names", "asc")</code></pre>
                <span class="commentary">Order rows by values of a column (high to low).</span>

                <pre><code class="python">df = df.cols.rename("names", "name")</code></pre>
                <span class="commentary">Rename the columns of a DataFrame.</span>

                <pre><code class="python">df = df.cols.rename([
  ("name", "names"),
  ("function", "task")])</code></pre>
                <span class="commentary">Drop columns from a DataFrame.</span>


                <h3>Handling Missing Data</h3>
                <pre><code class="python">df.rows.drop_na(cols)</code></pre>
                <span class="commentary">Drop rows any column having null data.</span>

                <pre><code class="python">df.cols.fill_na(cols, output_cols, value)</code></pre>
                <span class="commentary">Replace all null data with value.</span>

                <pre><code class="python">df.cols.impute(cols, strategy="mean")</code></pre>
                <span class="commentary">Replace all null data using a strategy.</span>

                <h3>Make new columns</h3>

                <div class="flex-row d-flex">
                    <div>
                        <table class="table-operations-no-data">
                            <thead>
                                <tr>
                                    <td class="gray"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>

                                </tr>
                            </tbody>
                        </table>
                    </div>

                    <div class="operation-symbol">
                        🡆
                    </div>
                    <div>
                        <table class="table-operations-no-data">
                            <thead>
                                <tr>
                                    <td class="gray"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="green"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

                <pre><code class="python">df.cols.append("new_rank", df["rank"]+"1")</code></pre>
                <span class="commentary">Compute and append a new column.</span>

                <pre><code class="python">df.cols.qcut("height", "bins", 2)</code></pre>
                <span class="commentary">Bin columns into n buckets.</span>

                <h3>String Processing</h3>
                <h4>Key Collision</h4>
                <pre><code class="python">df.cols.fingerprint(df, "names")</code></pre>
                <span class="commentary">Create a fingerprint from a string.</span>

                <pre><code class="python">df.string_clustering("names", "fingerprint")</code></pre>
                <span class="commentary">Cluster a dataframe column based on the fingerprint algorithm.</span>

                <pre><code class="python">df.cols.n_gram_fingerprint(df, "names", 2)</code></pre>
                <span class="commentary">Calculate the 2-gram for a fingerprinted string.</span>

                <pre><code class="python">df.string_clustering("names", "n_gram_fingerprint", 2)</code></pre>
                <span class="commentary">Cluster a DataFrame column based on the n-gram fingerprint algorithm.</span>
                <!-- TODO: levenshtein -->
                <!-- <h4>Distance Cluster</h4>
                <pre><code class="python">from optimus.ml import distancecluster as dc
                dc.levenshtein_matrix(df,"names")
                </code></pre>
                <span class="commentary">Create a couple of column with all the string combination.</span>

                <pre><code class="python">dc.levenshtein_filter(df,"names")
                </code></pre>
                <span class="commentary">Get the nearest string.</span>

                <pre><code class="python">dc.levenshtein_cluster(df,"names")
                </code></pre>
                <span class="commentary">Returna a strings of cluster related to a string.</span>
                </div>
                </div> -->


            </div>

            <div class="col-sm-4">
                <h3>Select Rows</h3>
                <div class="flex-row d-flex">
                    <div>
                        <table class="table-operations-no-data">
                            <thead>
                                <tr>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="gray-light"></td>
                                    <td class="gray-light"></td>
                                    <td class="gray-light"></td>
                                    <td class="gray-light"></td>
                                </tr>
                                <tr>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                </tr>
                                <tr>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="gray-light"></td>
                                    <td class="gray-light"></td>
                                    <td class="gray-light"></td>
                                    <td class="gray-light"></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="operation-symbol">
                        🡆
                    </div>
                    <div>
                        <table class="table-operations-no-data">
                            <thead>
                                <tr>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                </tr>
                                <tr>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                </tr>

                            </tbody>
                        </table>
                    </div>
                </div>
                <pre><code class="python">df.display(n)</code></pre>
                <span class="commentary">Show first n rows</span>

                <pre><code class="python">df.rows.drop_duplicated()</code></pre>
                <span class="commentary">Remove duplicate rows (only considers columns).</span>

                <pre><code class="python">df.rows.sample(n)</code></pre>
                <span class="commentary">Randomly select n rows</span>

                <pre><code class="python">df.rows.select(df["rank"]>7)</code></pre>
                <span class="commentary">Extract rows that meet logical criteria.</span>

                <table class="table-info">
                    <tbody>
                        <tr>
                            <td><pre><code class="python"> df["A"] &lt; df["B"]</code></pre></td>
                            <td>Less than</td>
                        </tr>
                        <tr>
                            <td><pre><code class="python"> df["A"] &gt; df["B"]</code></pre></td>
                            <td>Greater than</td>
                        </tr>
                        <tr>
                            <td><pre><code class="python"> df["A"] == df["B"]</code></pre></td>
                            <td>Equal to</td>
                        </tr>
                        <tr>
                            <td><pre><code class="python"> df["A"] &lt;= df["B"]</code></pre></td>
                            <td>Less than or equal to</td>
                        </tr>
                        <tr>
                            <td><pre><code class="python"> df["A"] &gt;= df["B"]</code></pre></td>
                            <td>Greater than or equal to</td>
                        </tr>
                        <tr>
                            <td><pre><code class="python"> df["A"] != df["B"]</code></pre></td>
                            <td>Not equal to</td>
                        </tr>
                        <tr>
                            <td><pre><code class="python">~df["A"]</code></pre></td>
                            <td>Negation</td>
                        </tr>
                        <tr>
                            <td><pre><code class="python"> df["A"] & df["B"]</code></pre></td>
                            <td>And</td>
                        </tr>
                        <tr>
                            <td><pre><code class="python"> df["A"] | df["B"]</code></pre></td>
                            <td>Or</td>
                        </tr>


                    </tbody>
                </table>

                <h3>Select Columns</h3>
                <div class="flex-row d-flex">
                    <div>
                        <table class="table-operations-no-data">
                            <thead>
                                <tr>
                                    <td class="gray"></td>
                                    <td class="green"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="green"></td>
                                    <td class="blue"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="green-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                    <td class="blue-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="green-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                    <td class="blue-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="green-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                    <td class="blue-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="green-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                    <td class="blue-light"></td>

                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="operation-symbol">
                        🡆
                    </div>
                    <div>
                        <table class="table-operations-no-data">
                            <thead>
                                <tr>
                                    <td class="gray"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <pre><code class="python">df.cols.select(["names", "height", "function"])</code></pre>
                <span class="commentary">Select multiple columns with specific names.</span>

                <pre><code class="python">df.cols.select([1, 3, 5])</code></pre>
                <span class="commentary">Select columns in positions 1, 3 and 5 (first column is 0)</span>

                <pre><code class="python">df.cols.select("n.*", regex=True)</code></pre>
                <span class="commentary">Select columns whose name matched regular expression regex.</span>

                <table class="table-info">
                    <tbody>
                        <tr>
                            <td>'\.</td>
                            <td>Matches strings containing a period</td>
                        </tr>
                        <tr>
                            <td>'Length$'</td>
                            <td>Matches strings ending wirt word 'Length'</td>
                        </tr>
                        <tr>
                            <td>'^$epal</td>
                            <td>Matches strings begining with the word 'Sepal'</td>
                        </tr>
                        <tr>
                            <td>'^x[1-5]$</td>
                            <td>Matches strings beginning with 'x' and ending with 1,2,3,4,5</td>
                        </tr>
                        <tr>
                            <td>''^(?!Species$).*'</td>
                            <td>Matches strings expect the string 'Species'</td>
                        </tr>
                    </tbody>
                </table>

                <h3>Unnest</h3>
                <div class="flex-row d-flex">
                    <div>
                        <table class="table-operations-no-data">
                            <thead>
                                <tr>
                                    <td class="gray"></td>
                                    <td class="blue"></td>
                                    <td class="green"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="operation-symbol">
                        🡆
                    </div>
                    <div>
                        <table class="table-operations-no-data">
                            <thead>
                                <tr>
                                    <td class="gray"></td>
                                    <td class="blue"></td>
                                    <td class="green"></td>
                                    <td class="green"></td>
                                    <td class="green"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                    <td class="green-light"></td>
                                    <td class="green-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                    <td class="green-light"></td>
                                    <td class="green-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                    <td class="green-light"></td>
                                    <td class="green-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                    <td class="green-light"></td>
                                    <td class="green-light"></td>

                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

                <pre><code class="python">df = df\
    cols.unnest("col_to_unnest")
    </code></pre>
                <span class="commentary">Unnest a string, array or vector column</span>

                <h3>Nest</h3>
                <div class="flex-row d-flex">
                    <div>
                        <table class="table-operations-no-data">
                            <thead>
                                <tr>
                                    <td class="gray"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>

                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>

                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="operation-symbol">
                        🡆
                    </div>
                    <div>
                        <table class="table-operations-no-data">
                            <thead>
                                <tr>
                                    <td class="gray"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="green"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                </tr>
                                <tr>
                                    <td class="gray-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="green-light"></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

                <pre><code class="python">df = df\
    .cols.nest(["names", "function"],
     output_col = "nested_col",
     separator=" ")</code></pre>
                <span class="commentary">Merge multiple columns as string</span>

                <pre><code class="python">df = df
    .cols.nest(["names", "function"],
    output_col = "new_col",
    shape ="array")</code></pre>
                <span class="commentary">Merge multiple columns as array</span>
                <h3>Plotting</h3>
                <pre><code class="python">df.plot.hist("*")</code></pre>
                <span class="commentary">Histogram for all columns.</span>

                <pre><code class="python">df.plot.frequency("*")</code></pre>
                <span class="commentary">Frequency plot for all columns.</span>

                <pre><code class="python">df.plots.correlation("*")</code></pre>
                <span class="commentary">Correlation plot for all columns.</span>


                <h3>Profiling</h3>
                <pre><code class="python">df.profile("*")</code></pre>
                <span class="commentary">Profile every column.</span>

                <pre><code class="python">df.profile("names")</code></pre>
                <span class="commentary">Profile a specific column.</span>
                
                <pre><code class="python">df.profile(["names", "height"])</code></pre>
                <span class="commentary">Profile multiple columns.</span>


            </div>
        </div>

        <div class="row d-none">
            <div class="col-sm-4 d-none">
                <h3>Outliers</h3>
                <div class="flex-row d-flex">
                    <div>
                        <table class="table-operations-no-data">
                            <thead>
                                <tr>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="red-light"></td>
                                    <td class="red-light"></td>
                                    <td class="red-light"></td>
                                    <td class="red-light"></td>
                                    <td class="red-light"></td>
                                </tr>
                                <tr>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                </tr>
                                <tr>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                </tr>
                                <tr>
                                    <td class="red-light"></td>
                                    <td class="red-light"></td>
                                    <td class="red-light"></td>
                                    <td class="red-light"></td>
                                    <td class="red-light"></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="operation-symbol">
                        🡆
                    </div>
                    <div>
                        <table class="table-operations-no-data">
                            <thead>
                                <tr>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                    <td class="blue"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                </tr>
                                <tr>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                    <td class="blue-light"></td>
                                </tr>

                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- TODO: plot -> outliers -->
                <pre><code class="python">df.plot.iqr("rank")</code></pre>
                <span class="commentary">Delete outliers using iqr method.</span>

                <pre><code class="python">df.plot.z_score("rank")</code></pre>
                <span class="commentary">Delete outliers using z-score method.</span>
                <pre><code class="python">df.plot.mad("rank")</code></pre>
                <span class="commentary">Delete outliers using mad method.</span>

                <pre><code class="python">df.plot.modified_z_score("rank")</code></pre>
                <span class="commentary">Delete outliers using modified z-score method.</span>


            </div>
            <div class="col-sm-4">


            </div>

</body>
</html>